﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xiaov.SmartWeb.Model;
using Xiaov.SmartWeb.Model.ActiveRecord;
using Xiaov.SmartWeb.Infrastructure.ExtMethod;
using AjaxPro;

namespace Xiaov.SmartWeb.Application.PluginSrc.StatisticalSystem.OGWell
{
    public partial class DJJCXX_Manage : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            PM_Filter();
            AjaxPro.Utility.RegisterTypeForAjax(typeof(DJJCXX_Manage));
        }
        [AjaxPro.AjaxMethod]
        public string RolesString(object o)
        {
            return "";
        }

        [AjaxPro.AjaxMethod]
        public bool Save(object jh, object dw, object dq, object qk, object cx, object cyjh, object tcrq, object sczt, object jb, object bz, object rowid)
        {
            try
            {
                DJJCXX model = new DJJCXX();
                model.JH = jh.ToRequestString();                
                model.DWBM = dw.ToRequestString();
                model.DQBM = dq.ToRequestString();
                model.QKBM = qk.ToRequestString();
                model.CXBM = cx.ToRequestString();
                model.CYJH = cyjh.ToRequestString();
                model.TCRQ = tcrq.ToRequestString();
                model.SCZT = sczt.ToRequestString();
                model.JB = jb.ToRequestString();
                model.BZ = bz.ToRequestString();
                model.Save();
                model.RefreshCache();
                return true;
            }
            catch
            {
                return false;
            }
        }

        [AjaxPro.AjaxMethod]
        public bool Delete(object jh)
        {
            try
            {
                DJJCXX model = DJJCXX.Find(jh);
                model.Delete();
                return true;
            }
            catch
            {
                return false;
            }

        }       

    }
}